-module(tictactoe_tests).
-include_lib("eunit/include/eunit.hrl").

tictactoe_when_passed_a_drawn_game_it_should_return_cat_test_() ->
    ?_assertEqual(cat, tictactoe:tictactoe([a,b,a,b,a,b,b,a,b])).

tictactoe_when_passed_an_unfinished_game_it_should_return_no_winner_test_() ->
    [?_assertEqual(no_winner, tictactoe:tictactoe([e,b,a,a,b,b,a,a,b])),
     ?_assertEqual(no_winner, tictactoe:tictactoe([a,b,b,b,a,b,a,a,e])),
     ?_assertEqual(no_winner, tictactoe:tictactoe([e,e,e,e,a,e,e,e,e]))
    ].

tictactoe_when_passed_a_won_game_it_should_return_the_winner_test_() ->
    [?_assert(tictactoe:tictactoe([a,a,a,e,a,e,e,e,e]) == a), 
     ?_assert(tictactoe:tictactoe([a,b,a,e,b,e,e,b,e]) == b), 
     ?_assert(tictactoe:tictactoe([a,b,a,e,a,e,e,b,a]) == a)
    ].


%% Run with tictactoe_tests:test().
